package example6_1;

import java.sql.SQLOutput;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-03-22
 * Time: 15:16
 */
public class Test {
    public static void main(String[] args) {
        int[] array = {3,1,6,2,9,0,7,4,5,8};
        System.out.println("数组排列前的循序为：");
        for (int i = 0; i < args.length; i++) {
            System.out.println(array[i]+" ");
        }
        int temp;
        for (int i = 0; i < array.length - 1; i++) {
            for (int j = 0; j < array.length - 1 - i; j++) {
                if(array[j] > array[j + 1]){
                    temp = array[j];
                    array[j] = array[j + 1];
                    array[j + 1] = temp;

                }
            }
        }
        System.out.println();
        System.out.println("数组排序后的循序为：");
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]+" ");
        }
    }
}
